package com.wiki.controller;

import com.wiki.service.TestService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class TestController {

//    @GetMapping("/test")
//    public String testGet() {
//        return "test";
//    }
//
//    @PostMapping("/test")
//    public String testPost(@RequestBody String body) {
//        return "test: " + body;
//    }

    @Resource
    private TestService testService;

    @GetMapping("/test")
    public String testGet() {
        return "{‘status’: 200}";
    }

    @PostMapping("/test")
    public String testPost(@RequestBody String body) {
        return body;
    }

    // 查询Test
    @GetMapping("/test/list")
    public Object list() {
        return testService.list();
    }

}
